<?php
/**
 * Author：小鱼
 * QQ:34734852
 * Wechat:34734852
 */
 namespace Home\Model;
 use Think\Model\RelationModel;
 
class GoodsModel extends RelationModel{
    
    protected $_link = array (
        'category' => array(
         'mapping_type' => self::BELONGS_TO,
            'mapping_name'=>'cate',
            'mapping_fields'=>'name,id,pid',
            'class_name' => 'category',
            'foreign_key' => 'category'
        ),
        'brand' => array(
            'mapping_type' => self::BELONGS_TO,
            'mapping_name'=>'pinpai',
            'class_name' => 'brand',
            'foreign_key' => 'brand'
        ),
    );
    

}